/*
 * File : $HeadURL$
 * Date : $Date: 2011-02-22 16:34:35 +0100 (Di, 22 Feb 2011) $
 * Version: $Revision: 5 $
 * 
 * This file is part of BIDS, the batch image downscaler.
 * 
 * Copyright (C) 2011 Michael Moossen
 */

package net.moossen.bids;

import java.io.File;

import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;

/**
 * Command-line options definition.
 * 
 * @author Michael Moossen
 * 
 * @version $Revision: 5 $
 */
public class Options {

    /** The filter argument. */
    private String m_argument;

    /** The maximal height in pixels. */
    private String m_height = "966"; //$NON-NLS-1$

    /** The help flag. */
    private boolean m_help;

    /** The input directory. */
    private File m_in = new File("."); //$NON-NLS-1$

    /** The output directory. */
    private File m_out = new File(m_in, "out"); //$NON-NLS-1$

    /** The overwrite flag. */
    private boolean m_replace;

    /** The maximal width in pixels. */
    private String m_width = "1288"; //$NON-NLS-1$

    /**
     * Returns the argument.
     * 
     * @return the argument
     */
    public String getArgument() {

        return m_argument;
    }

    /**
     * Returns the maximal height in pixels.
     * 
     * @return the maximal height in pixels
     */
    public String getHeight() {

        return m_height;
    }

    /**
     * Returns the input directory.
     * 
     * @return the input directory
     */
    public File getIn() {

        return m_in;
    }

    /**
     * Returns the output directory.
     * 
     * @return the output directory
     */
    public File getOut() {

        return m_out;
    }

    /**
     * Returns the maximal width in pixels.
     * 
     * @return the maximal width in pixels
     */
    public String getWidth() {

        return m_width;
    }

    /**
     * Returns the help flag.
     * 
     * @return the help flag
     */
    public boolean isHelp() {

        return m_help;
    }

    /**
     * Returns the replace flag.
     * 
     * @return the replace flag
     */
    public boolean isReplace() {

        return m_replace;
    }

    /**
     * Sets the argument.
     * 
     * @param argument the argument to set
     */
    @Argument(usage = "regex to filter the files to downscale, \ndefaults to all files")
    public void setArgument(final String argument) {

        m_argument = argument;
    }

    /**
     * Sets the maximal height in pixels.
     * 
     * @param height the height to set
     */
    @Option(name = "-h", usage = "max height in px to downscale pictures to, \ndefaults to 966", aliases = "--height")
    public void setHeight(final String height) {

        m_height = height;
    }

    /**
     * Sets the help flag.
     * 
     * @param help the help flag to set
     */
    @Option(name = "--help", usage = "shows this help screen")
    public void setHelp(final boolean help) {

        m_help = help;
    }

    /**
     * Sets the in.
     * 
     * @param in the in to set
     */
    @Option(name = "-in", usage = "input directory, \ndefaults to current directory", aliases = "--input-dir")
    public void setIn(final File in) {

        m_in = in;
    }

    /**
     * Sets the output directory.
     * 
     * @param out the out to set
     */
    @Option(name = "-out", usage = "output to this directory, \nwill be created if it does not exist, \ndefaults to 'out'", aliases = "--output-dir")
    public void setOut(final File out) {

        m_out = out;
    }

    /**
     * Sets the overwrite flag.
     * 
     * @param replace the replace flag to set
     */
    @Option(name = "-r", usage = "overwrite existing files", aliases = "--replace, --overwrite")
    public void setReplace(final boolean replace) {

        m_replace = replace;
    }

    /**
     * Sets the maximal width in pixels.
     * 
     * @param width the width to set
     */
    @Option(name = "-w", usage = "max width in px to downscale pictures to, \ndefaults to 1288", aliases = "--width")
    public void setWidth(final String width) {

        m_width = width;
    }
}
